package com.car.util;

import java.io.IOException;

import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

import com.car.exception.FreemarkerExceptionHandler;

import freemarker.template.TemplateException;

public class CarFreemarkerConfigration extends FreeMarkerConfigurer {

	public void afterPropertiesSet() throws IOException, TemplateException {
		if (getConfiguration() == null) {
			setConfiguration(createConfiguration());
		}
		getConfiguration().setTemplateExceptionHandler(new FreemarkerExceptionHandler());
		getConfiguration().setClassicCompatible(true);
		//设置异常处理器  
        //cfg.setTemplateExceptionHandler(TemplateExceptionHandler.IGNORE_HANDLER);  
	}

}
